home *** CD-ROM | disk | FTP | other *** search
/ Delmar Learning's Anatomy…Physiology Image Library / Delmar Learning's Anatomy & Physiology Image Library.iso / DATA / IL.js < prev    next >
Encoding:
Text File  |  2003-03-07  |  2.2 KB  |  80 lines

  1. <!-- Disable Right Click
  2. var message="";
  3. function clickIE() {if (document.all) {(message);return false;}}
  4. function clickNS(e) {if 
  5. (document.layers||(document.getElementById&&!document.all)) {
  6. if (e.which==2||e.which==3) {(message);return false;}}}
  7. if (document.layers) 
  8. {document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}
  9. else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}
  10.  
  11. document.oncontextmenu=new Function("return false")
  12. // End Disable Right Click-->
  13.  
  14. <!-- Disable Select Text
  15. function disableselect(e){
  16. return false
  17. }
  18.  
  19. function reEnable(){
  20. return true
  21. }
  22.  
  23. //if IE4+
  24. document.onselectstart=new Function ("return false")
  25.  
  26. //if NS6
  27. if (window.sidebar){
  28. document.onmousedown=disableselect
  29. document.onclick=reEnable
  30. }
  31. // End Disable Select Text-->
  32.  
  33.  
  34. <!-- Begin DropMenu
  35. function leapto(form) {
  36. var myindex=form.dest.selectedIndex
  37. parent.bottomFrame.location.href=(form.dest.options[myindex].value);
  38. }
  39. // End DropMenu-->
  40.  
  41. <!--PrintImage
  42. var da = (document.all) ? 1 : 0;
  43. var pr = (window.print) ? 1 : 0;
  44. var mac = (navigator.userAgent.indexOf("Mac") != -1); 
  45.  
  46. function printPage() {
  47.   if (pr) // NS4, IE5
  48.     window.print()
  49.   else if (da && !mac) // IE4 (Windows)
  50.     vbPrintPage()
  51.   else // other browsers
  52.     alert("Sorry, your browser doesn't support this feature.");
  53.   return false;
  54. }
  55.  
  56. if (da && !pr && !mac) with (document) {
  57.   writeln('<OBJECT ID="WB" WIDTH="0" HEIGHT="0" CLASSID="clsid:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>');
  58.   writeln('<' + 'SCRIPT LANGUAGE="VBScript">');
  59.   writeln('Sub window_onunload');
  60.   writeln('  On Error Resume Next');
  61.   writeln('  Set WB = nothing');
  62.   writeln('End Sub');
  63.   writeln('Sub vbPrintPage');
  64.   writeln('  OLECMDID_PRINT = 6');
  65.   writeln('  OLECMDEXECOPT_DONTPROMPTUSER = 2');
  66.   writeln('  OLECMDEXECOPT_PROMPTUSER = 1');
  67.   writeln('  On Error Resume Next');
  68.   writeln('  WB.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER');
  69.   writeln('End Sub');
  70.   writeln('<' + '/SCRIPT>');
  71. }
  72. //End PrintImage-->
  73.  
  74. <!-- CopyImage
  75. function copyTo(sImgID) {
  76. var ctrlRange = document.body.createControlRange();
  77. ctrlRange.add(document.all(sImgID));
  78. ctrlRange.execCommand("Copy");
  79. }
  80. //End CopyImage-->